package com.xbongbong.sso.pojo.dto;

import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 授权步骤添加
 */
@Getter
@Setter
@ToString
public class OauthCustomParamAddDTO extends BaseDTO {

    /**
     * 授权连接器id
     */
    @NotNull(message = "授权连接器id不能为空")
    private Long connectorId;

    /**
     * 参数名称
     */
    @NotNull(message = "参数名称不能为空")
    @NotEmpty(message = "参数名称不能为空")
    @Size(max = 20, message = "参数名称长度不可超过20")
    private String name;

    /**
     * 参数apiKey
     */
    @NotNull(message = "参数apiKey不能为空")
    @NotEmpty(message = "参数apiKey不能为空")
    @Size(max = 20, message = "参数apiKey长度不可超过20")
    private String attr;

    /**
     * 初始值
     */
    @NotNull(message = "初始值不能为空")
    @NotEmpty(message = "初始值不能为空")
    @Size(max = 200, message = "初始值长度不可超过200")
    private String value;

    /**
     * 启用状态, 1:启用、0:关闭
     */
    @Range(min = 0, max = 1, message = "启用状态只能是0或1")
    private Integer enable;

    /**
     * 描述
     */
    @Size(max = 100, message = "描述长度不可超过100")
    private String description;
}
